package com.xinrui.sunnyday.dao;

import com.xinrui.sunnyday.pojo.Member;
import com.xinrui.sunnyday.pojo.Order;
import org.apache.ibatis.annotations.Param;
import org.aspectj.weaver.ast.Or;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface OrderDao {
    /**
     * 生成订单:查询数据库中是否有此订单
     *
     * @param orders
     * @return
     */
    Order findOrder(Order orders);

    /**
     * 生成订单：添加数据生成订单
     *
     * @param orders
     * @return
     */
    void insertOrder(Order orders);

    /**
     * 多表查询：查询订单信息
     *
     * @param id
     * @return
     */
    Map<String, Object> findById(Integer id);

    /**
     * 查询当天预约人数
     *
     * @param today
     * @return
     */
    int findOrderCountByDate(String today);

    /**
     * 查询当天到诊人数
     *
     * @param today
     * @return
     */
    int findVisitsCountByDate(String today);

    /**
     * 查询本周,本月预约人数
     *
     * @param thisWeekMonday
     * @param sundayOfThisWeek
     * @return
     */
    int findOrderCountBetweenDate(@Param("thisWeekMonday") String thisWeekMonday,@Param("sundayOfThisWeek") String sundayOfThisWeek);

    /**
     * 本周,本月到诊数
     *
     * @param thisWeekMonday
     * @return
     */
    int findVisitsCountAfterDate(String thisWeekMonday);

    /**
     * 查询热门套餐
     *
     * @return
     */
    List<Map<String, Object>> findHotSetmeal();
}
